package com.start.workflow.vo;

import io.swagger.v3.oas.annotations.media.Schema;

import lombok.Data;
import org.activiti.engine.task.Task;

import java.util.Date;

@Data
 @Schema(name="ProcessTaskInfo", description = "流程任务信息")
public class ProcessTaskInfo extends BaseProcessInfo<Task, ProcessTaskInfo> {
     @Schema(name="名称")
    private String name;
     @Schema(name="业务key")
    private String businessKey;
     @Schema(name="流程实例id")
    private String processInstanceId;
     @Schema(name="任务定义key")
    private String taskDefinitionKey;
     @Schema(name="流程定义id")
    private String processDefinitionId;
     @Schema(name="应程序版本")
    private Integer appVersion;
     @Schema(name="流程处理人")
    private String assignee;
     @Schema(name="任务创建时间")
    private Date createTime;
     @Schema(name="任务优先级")
    private int priority;

    @Override
    public ProcessTaskInfo transform(Task object) {
        setId(object.getId());
        name = object.getName();
        businessKey = object.getBusinessKey();
        processInstanceId = object.getProcessInstanceId();
        taskDefinitionKey = object.getTaskDefinitionKey();
        processDefinitionId = object.getProcessDefinitionId();
        appVersion = object.getAppVersion();
        assignee = object.getAssignee();
        createTime = object.getCreateTime();
        priority = object.getPriority();
        return this;
    }
}
